package demo.practice.leetcode_base;

import demo.practice.leetcode.IsBalanced2;

public class Offer55 {


    public int maxDepth(IsBalanced2.TreeNode root) {

        if(root==null)
            return 0;
        if(root.left!=null || root.right!=null)
            return  1+ Math.max(maxDepth(root.left),maxDepth(root.right));
        else
            return 1;
    }




}
